#ifndef _UDP_H_INCLUDED_
#define _UDP_H_INCLUDED_

#include "defines.h"

typedef struct {
    uint16 port;
    kz_msgbox_id_t mbox;
} udp_receiver;

void udp_init(void);
void handle_udp(uint8 *packet);
void udp_send(uint8 *data, uint16 size, uint16 src_port, uint16 dst_port, const uint8 dst_IP[]);
void udp_main(int argc, char *argv);

const udp_receiver *udp_use(uint16 port);
void udp_close(const udp_receiver *receiver);

#endif
